package ms.sudoku.technique;

import java.util.Comparator;

/**
 * Allows for the sorting of EliminationTechniques by difficulty level.
 */
public class TechniqueDifficultyComparator implements Comparator<EliminationTechnique> {
	public int compare(EliminationTechnique a, EliminationTechnique b) {
		if (a == null && b == null) {
			return 0;
		} else if (a == null) {
			return 1;
		} else if (b == null) {
			return -1;
		} else {
			return Long.compare(a.getDifficultyLevel(), b.getDifficultyLevel());
		}
	}
}